/**
* 版权所有：版权所有(C) 2014
* 文件编号：
* 文件名称: xmFinanceService.java
* 系统编号：
* 系统名称：贝优特项目管理
* 模块编号： 
* 模块名称：项目管理--金额财务相关模块：如：开票，进度收款，报销等
* 设计文件：
* 完成日期：2014-12-01 
* 作    者：lanjinsheng
* 内容摘要：
* 属性描述：
* 方法描述：该类有n个方法：
* 文件调用：单例加载。在Control类中调用
*/
package com.beaut.project.control;


import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.beaut.project.service.XMFinanceService;
import com.beaut.project.util.Utility;

/**
 * 项目财务模块管理
 * @author LJS
 *
 */
@Controller
@RequestMapping("/xmFinance")
public class XMFinanceController  extends BaseControl{
	@Autowired 
	XMFinanceService xmFinanceService;
	
	private Logger logger = Logger.getLogger(XMFinanceController.class);

    @RequestMapping(value = "/addXMInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMInvoice(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.addXMInvoice(map);
    }
    @RequestMapping(value = "/addXMEndInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMEndInvoice(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
    	map.put("creator_id", map.get("author_id"));
    	map.put("creator", map.get("author_name"));
    	return xmFinanceService.addXMEndInvoice(map);
    }
    @RequestMapping(value = "/addXMReimLoan", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMReimLoan(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
    	map.put("creator_id", map.get("author_id"));
    	map.put("creator", map.get("author_name"));
    	return xmFinanceService.addXMReimLoan(map);
    }
    @RequestMapping(value = "/updateXMReimLoan", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMReimLoan(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
    	map.put("creator_id", map.get("author_id"));
    	map.put("creator", map.get("author_name"));
    	return xmFinanceService.updateXMReimLoan(map);
    }
      /**
       * 
       * 更新开票信息
       * @param request
       * @return
       */
    @RequestMapping(value = "/updateXMInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMInvoice(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.updateXMInvoice(map);
    }
    @RequestMapping(value = "/updateXMEndInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMEndInvoice(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
    	map.put("creator_id", map.get("author_id"));
    	map.put("creator", map.get("author_name"));
    	return xmFinanceService.updateXMEndInvoice(map);
    }
    /**
     * 
     * 更新开票信息
     * @param request
     * @return
     */
    @RequestMapping(value = "/updateXmRecFlag", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXmRecFlag(HttpServletRequest request) {
    	return xmFinanceService.updateXmRecFlag(requestParameterToMapUser(request));
    }
    @RequestMapping(value = "/listPageXMInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMInvoice(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
    	 map.putAll(requestParameterToMapUser(request));
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listPageXMInvoice(map);
    }
    /**
     * 部门年度统计
     * @param request
     * @return
     */
    @RequestMapping(value = "/listFinanceInfoByYear", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listFinanceInfoByYear(HttpServletRequest request) {
    	return xmFinanceService.listFinanceInfoByYear(requestParameterToMapUser(request));
    }
    /**
     * 收票列表展示
     * @param request
     * @return
     */
    @RequestMapping(value = "/listPageXMRecInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMRecInvoice(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMapUser(request));
    	if(this.isAdmin(request)){ 
    	}else{
    		map.put("person_id", map.get("author_id"));
    	}
    	return xmFinanceService.listPageXMRecInvoice(map);
    }
    /**
     *项目报账收付款
     * @param request
     * @return
     */
    @RequestMapping(value = "/listPageXMRpLoan", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMRpLoan(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMapUser(request));
    	if(this.isAdmin(request)){ 
    	}else{
    		map.put("person_id", map.get("author_id"));
    	}
    	return xmFinanceService.listPageXMRpLoan(map);
    }
    @RequestMapping(value = "/listFbAdvances", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listFbAdvances(HttpServletRequest request) {
    	return xmFinanceService.listFbAdvances(requestParameterToMapUser(request));
    }
   
    
    /**
     * 项目开票查看
     */
    @RequestMapping(value = "/ getXMInvoiceById", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  getXMInvoiceById(HttpServletRequest request) {
    	return xmFinanceService. getXMInvoiceById(requestParameterToMap(request));
    }
    /**
     * 项目报账收付款详情
     */
    @RequestMapping(value = "/ getReimLoanById", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  getReimLoanById(HttpServletRequest request) {
    	return xmFinanceService. getReimLoanById(requestParameterToMap(request));
    }
    /**
     * 项目开票分包商分摊查看
     */
    @RequestMapping(value = "/ getXMInvoiceDetail", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  getXMInvoiceDetail(HttpServletRequest request) {
    	return xmFinanceService. getXMInvoiceDetail(requestParameterToMap(request));
    }
    @RequestMapping(value = "/ getGdAdvancesMoneyById", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  getGdAdvancesMoneyById(HttpServletRequest request) {
    	return xmFinanceService. getGdAdvancesMoneyById(requestParameterToMap(request));
    }
    /**
     * 项目开票删除
     */
    @RequestMapping(value = "/ deleteInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  deleteInvoice(HttpServletRequest request) {
    	return xmFinanceService.deleteInvoice(requestParameterToMap(request));
    } 
    /**
     * 项目报账收付款删除
     */
    @RequestMapping(value = "/ deleteReimLoan", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  deleteReimLoan(HttpServletRequest request) {
    	return xmFinanceService.deleteReimLoan(requestParameterToMap(request));
    } 
    
    
    /**
     * 项目开票收款查看
     */
    @RequestMapping(value = "/listPageXMInMoney", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMInMoney(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
    	 map.putAll(requestParameterToMapUser(request));
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listPageXMInMoney(map);
    }
    /**
     * 项目收款添加
     */
    @RequestMapping(value = "/addXMInMoney", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMInMoney(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.addXMInMoney(map);
    }
    
    /**
     * 项目收款更新
     */
    @RequestMapping(value = "/updateXMInMoney", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMInMoney(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.updateXMInMoney(map);
    }
    /**
     * 项目结算收款添加
     */
    @RequestMapping(value = "/addXMEndInMoney", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMEndInMoney(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.addXMEndInMoney(map);
    }
    /**
     * 项目结算收款更新
     */
    @RequestMapping(value = "/updateXMWarrantyInMoney", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMWarrantyInMoney(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.updateXMInMoney(map);
    }
    /**
     * 项目结算收款添加
     */
    @RequestMapping(value = "/addXMWarrantyInMoney", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMWarrantyInMoney(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
    	map.put("creator_id", map.get("author_id"));
    	map.put("creator", map.get("author_name"));
    	return xmFinanceService.addXMWarrantyInMoney(map);
    }
    /**
     * 项目结算收款更新
     */
    @RequestMapping(value = "/updateXMEndInMoney", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMEndInMoney(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
    	map.put("creator_id", map.get("author_id"));
    	map.put("creator", map.get("author_name"));
    	return xmFinanceService.updateXMEndInMoney(map);
    }
    /**
     * 项目收款查看
     */
    @RequestMapping(value = "/ getInMoneyById", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  getInMoneyById(HttpServletRequest request) {
    	return xmFinanceService. getInMoneyById(requestParameterToMap(request));
    }
   
    /**
     * 项目收款删除
     */
    @RequestMapping(value = "/ deleteInMoney", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  deleteInMoney(HttpServletRequest request) {
    	return xmFinanceService.deleteInMoney(requestParameterToMap(request));
    } 
//    @RequestMapping(value = "/getJGMaterial", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
//    public @ResponseBody String getJGMaterial(HttpServletRequest request) {
//    	 Map<String, Object> map = requestParameterToMapUser(request);
//    	 if(this.isAdmin(request)){ 
//    	 }else{
//    		 map.put("person_id", map.get("author_id"));
//    	 }
//    	return xmFinanceService.getJGMaterial(map);
//    }
//    @RequestMapping(value = "/getXMFlowInDetail", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
//    public @ResponseBody String getXMFlowInDetail(HttpServletRequest request) {
//    	 Map<String, Object> map = requestParameterToMapUser(request);
//    	 if(this.isAdmin(request)){ 
//    	 }else{
//    		 map.put("person_id", map.get("author_id"));
//    	 }
//    	return xmFinanceService.getXMFlowInDetail(map);
//    }
//    转移到workflowControl
//    @RequestMapping(value = "/flowBackToXMBasesDeal", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
//    public @ResponseBody String flowBackToXMBasesDeal(HttpServletRequest request) {
//    	 Map<String, Object> map = requestParameterToMapUser(request);
//    	 map.put("id",map.get("key"));
//    	return xmFinanceService.flowBackToXMBasesDeal(map);
//    }
//    转移到workflowcontrol
//    @RequestMapping(value = "/flowBackToXMInMoneyDeal", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
//    public @ResponseBody String flowBackToXMInMoneyDeal(HttpServletRequest request) {
//    	 Map<String, Object> map = requestParameterToMapUser(request);
//    	 map.put("id",map.get("key"));
//    	return xmFinanceService.flowBackToXMInMoneyDeal(map);
//    }

    /**
     * 项目支付管理
     */
    @RequestMapping(value = "/listPageXMPayment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMPayment(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
    	 map.putAll(requestParameterToMapUser(request));
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listPageXMPayment(map);
    } 
    /**
     * 项目结算支付管理
     */
    @RequestMapping(value = "/listPageXMEndPayment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMEndPayment(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
    	 map.putAll(requestParameterToMapUser(request));
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listPageXMEndPayment(map);
    } 
    
    /**
     * 财务未处理项目支付管理
     */
    @RequestMapping(value = "/listPageXMFinancePayment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMFinancePayment(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
    	 map.putAll(requestParameterToMapUser(request));
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listPageXMFinancePayment(map);
    }   
    /**
     * 财务已处理项目支付管理
     */
    @RequestMapping(value = "/listPageXMFinanceFinishPayment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMFinanceFinishPayment(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
    	 map.putAll(requestParameterToMapUser(request));
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listPageXMFinanceFinishPayment(map);
    }   
    /**
     * 财务未处理项目收款管理
     */
    @RequestMapping(value = "/listPageXMFinanceEarn", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMFinanceEarn(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
    	 map.putAll(requestParameterToMapUser(request));
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listPageXMFinanceEarn(map);
    }   
    /**
     * 财务已处理项目收款管理
     */
    @RequestMapping(value = "/listPageXMFinanceFinishEarn", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMFinanceFinishEarn(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
    	 map.putAll(requestParameterToMapUser(request));
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listPageXMFinanceFinishEarn(map);
    }     
    
    /**
     * 项目开报账管理
     */
    @RequestMapping(value = "/listPageXMReimbursement", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMReimbursement(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMapUser(request));
    	return xmFinanceService.listPageXMReimbursement(map);
    }
    /**
     * 项目工单借款单列表
     * @param request
     * @return
     */
     @RequestMapping(value = "/listGdLoanByXmId", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
     public @ResponseBody String listGdLoanByXmId(HttpServletRequest request) {
     	return xmFinanceService.listGdLoanByXmId(requestParameterToMap(request));
     }
     /**
      * 项目工单借款单列表
      * @param request
      * @return
      */
     @RequestMapping(value = "/listPageXmReim", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
     public @ResponseBody String listPageXmReim(HttpServletRequest request) {
    	 Map<String, Object> map = getPagerMap(request);
     	map.putAll(requestParameterToMapUser(request));
    	 return xmFinanceService.listPageXmReim(map);
     }
     /**
      * 项目报账添加
      */
     @RequestMapping(value = "/addXMReimbursement", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
     public @ResponseBody String addXMReimbursement(HttpServletRequest request) {
     	
     	return xmFinanceService.addXMReimbursement(requestParameterToMap(request));
     }
     /**
      *项目报账编辑
      */
     @RequestMapping(value = "/updateXMReimbursement", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
     public @ResponseBody String updateXMReimbursement (HttpServletRequest request) {
     	
     	return xmFinanceService.updateXMReimbursement(requestParameterToMap(request));
     }
     /**
      * 项目收票添加
      */
     @RequestMapping(value = "/addXMRecInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
     public @ResponseBody String addXMRecInvoice(HttpServletRequest request) {
    	 
    	 return xmFinanceService.addXMRecInvoice(requestParameterToMap(request));
     }
     /**
      *项目收票编辑
      */
     @RequestMapping(value = "/updateXMRecInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
     public @ResponseBody String updateXMRecInvoice (HttpServletRequest request) {
    	 
    	 return xmFinanceService.updateXMRecInvoice(requestParameterToMap(request));
     }
     /**
      * 项目收票查看明细
      */
     @RequestMapping(value = "/ getXmRecInvoiceById", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
     public @ResponseBody String  getXmRecInvoiceById(HttpServletRequest request) {
     	return xmFinanceService. getXmRecInvoiceById(requestParameterToMap(request));
     }
     /**
      * 删除项目收票
      * @param request
      * @return
      */
     @RequestMapping(value = "/deleteRecInvoice", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
 	public @ResponseBody String deleteRecInvoice(HttpServletRequest request) {
 		return xmFinanceService.deleteRecInvoice(requestParameterToMap(request));
 	} 
     /**
      *项目报账操作
      */
     @RequestMapping(value = "/updateXmRemLoan", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
     public @ResponseBody String updateXmRemLoan (HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    		 map.put("creator_id", map.get("author_id"));
    		 map.put("creator", map.get("author_name"));
    	 return xmFinanceService.updateXmRemLoan(map);
     }
     /**
      * 根据报账单id查询明细
      * @param request
      * @return
      */
     @RequestMapping(value = "/getReimbursementById", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
     public @ResponseBody String getReimbursementById(HttpServletRequest request) {
     	 Map<String, Object> map = requestParameterToMapUser(request);
     	return xmFinanceService.getReimbursementById(map);
     }
     /**
      * 删除项目报账
      * @param request
      * @return
      */
     @RequestMapping(value = "/deleteReimbursement", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
 	public @ResponseBody String deleteReimbursement(HttpServletRequest request) {
 		return xmFinanceService.deleteReimbursement(requestParameterToMap(request));
 	} 
    /**
     * 项目支付选择供应商
     */
    @RequestMapping(value = "/listXMSuppliers", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listXMSuppliers(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listXMSuppliers(map);
    } 
     
    /**
     * 项目支付选择施工队
     */
    @RequestMapping(value = "/listXMWorkers", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listXMWorkers(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listXMWorkers(map);
    } 
    /**
     * 项目工单供应商支付
     */
    @RequestMapping(value = "/listXMGDSupplyPayment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listXMGDSupplyPayment(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listXMGDSupplyPayment(map);
    } 
    
    /**
     * 项目工单施工方支付
     */
    @RequestMapping(value = "/listXMGDWorkerPayment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listXMGDWorkerPayment(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listXMGDWorkerPayment(map);
    } 
    
    
    
    /**
     * 添加项目工单供应商支付
     */
    @RequestMapping(value = "/addXMPaySupply", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMPaySupply(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.addXMPaySupply(map);
    }
    /**
     * 添加项目工单供应商结算支付
     */
    @RequestMapping(value = "/addXMPayEndSupply", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMPayEndSupply(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.addXMPayEndSupply(map);
    }
    /**
     * 添加项目工单施工方支付
     */
    @RequestMapping(value = "/addXMPayWorker", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMPayWorker(HttpServletRequest request) {
    	try{	
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.addXMPayWorker(map);
    	}catch(Exception e){
   	   	 logger.error("分包支付失败--------------------",e);
   	    }
    	return Utility.rtJson(Utility.RETURN_ERROR, "添加失败", null);
    }
    /**
     * 添加项目工单施工方支付--结算
     */
    @RequestMapping(value = "/addXMEndPayWorker", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String addXMEndPayWorker(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.addXMEndPayWorker(map);
    }
    /**
     * 更新项目工单供应商支付
     */
    @RequestMapping(value = "/updateXMPaySupply", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMPaySupply(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.updateXMPaySupply(map);
    }
    /**
     * 更新项目工单供应商支付--结算
     */
    @RequestMapping(value = "/updateXMEndPaySupply", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMEndPaySupply(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.updateXMEndPaySupply(map);
    }
    /**
     * 更新项目工单施工方支付
     */
    @RequestMapping(value = "/updateXMPayWorker", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMPayWorker(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.updateXMPayWorker(map);
    }
    /**
     * 更新项目工单施工方支付
     */
    @RequestMapping(value = "/updateXMEndPayWorker", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateXMEndPayWorker(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.updateXMEndPayWorker(map);
    }
    /**
     * 查看项目工单供应商支付申请表
     */
    @RequestMapping(value = "/viewXmPay", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public @ResponseBody String viewXmPay(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.viewXmPay(map);
    } 
    /**
     * 查看项目工单供应商支付申请表详情
     */
    @RequestMapping(value = "/viewXmPayDetail", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String viewXmPayDetail(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.viewXmPayDetail(map);
    }
    /**
     * 查看项目工单施工方支付申请表详情
     */
    @RequestMapping(value = "/viewXmPayWorkerDetail", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String viewXmPayWorkerDetail(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.viewXmPayWorkerDetail(map);
    }  
    /**
     * 删除支付申请单
     */
    @RequestMapping(value = "/deleteXMPayment", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  deleteXMPayment(HttpServletRequest request) {
    	return xmFinanceService.deleteXMPayment(requestParameterToMap(request));
    } 
    
    
    /**
     * 项目财务批量放款确认，包含供应商与施工方
     */
    @RequestMapping(value = "/updateXmFinanceOut", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  updateXmFinanceOut(HttpServletRequest request) {
    	return xmFinanceService.updateXmFinanceOut(requestParameterToMapUser(request));
    } 
    /**
     * 放款项目支付供应商
     */
    @RequestMapping(value = "/updateXmSupFinanceOut", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  updateXmSupFinanceOut(HttpServletRequest request) {
    	return xmFinanceService.updateXmSupFinanceOut(requestParameterToMapUser(request));
    } 
    
    /**
     * 放款项目支付施工队
     */
    @RequestMapping(value = "/updateXmWorkerOut", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  updateXmWorkerOut(HttpServletRequest request) {
    	return xmFinanceService.updateXmWorkerOut(requestParameterToMapUser(request));
    } 
    /**
     * 收款项目
     */
    @RequestMapping(value = "/updateXmEarn", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String  updateXmEarn(HttpServletRequest request) {
    	return xmFinanceService.updateXmEarn(requestParameterToMapUser(request));
    } 
    
    
    /**
     * 项目对应所有开票记录
     */
    @RequestMapping(value = "/listXMInvoiceByXMId", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listXMInvoiceByXMId(HttpServletRequest request) {
    	 Map<String, Object> map = requestParameterToMapUser(request);
    	 if(this.isAdmin(request)){ 
    	 }else{
    		 map.put("person_id", map.get("author_id"));
    	 }
    	return xmFinanceService.listXMInvoiceByXMId(map);
    }    
    /**
     * 判断是否拥有收入平衡统计
     * @param request
     * @return
     */
    @RequestMapping(value = "/hasXMEndInMoney", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    public @ResponseBody String hasXMEndInMoney(HttpServletRequest request) {
    	return xmFinanceService.hasXMEndInMoney(requestParameterToMap(request));
    }
    /**
     * 项目结算收款查看详情
     */
    @RequestMapping(value = "/listXMEndInMoneyDetail", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listXMEndInMoneyDetail(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.listXMEndInMoneyDetail(map);
    }
    /**
     * 项目结算采购商结算
     */
    @RequestMapping(value = "/getXMPurchaseBalanceByXMId", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String getXMPurchaseBalanceByXMId(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.getXMPurchaseBalanceByXMId(map);
    }  
    /**
     * 项目结算分包商结算
     */
    @RequestMapping(value = "/listXMWorkersBalanceByXMId", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listXMWorkersBalanceByXMId(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
		map.put("creator_id", map.get("author_id"));
		map.put("creator", map.get("author_name"));
    	return xmFinanceService.listXMWorkersBalanceByXMId(map);
    }    
    /**
     * 判断是否拥项目结算
     * @param request
     * @return
     */
    @RequestMapping(value = "/hasXMEndPayMain", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    public @ResponseBody String hasXMEndPayMain(HttpServletRequest request) {
    	return xmFinanceService.hasXMEndPayMain(requestParameterToMap(request));
    }
    /**
     * 项目支出结算审批列表
     * @param request
     * @return
     */
    @RequestMapping(value = "/listXMEndPayMain", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    public @ResponseBody String listXMEndPayMain(HttpServletRequest request) {
    	return xmFinanceService.listXMEndPayMain(requestParameterToMap(request));
    }
    /**
     * 项目分包商支付-结算
     * @param request
     * @return
     */
    @RequestMapping(value = "/listFBEndPayByXMIdAndWorkerId", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    public @ResponseBody String listFBEndPayByXMIdAndWorkerId(HttpServletRequest request) {
    	return xmFinanceService.listFBEndPayByXMIdAndWorkerId(requestParameterToMap(request));
    }
    /**
     * 项目采购商支付-结算
     * @param request
     * @return
     */
    @RequestMapping(value = "/listCGEndPayByXMIdAndsupplierId", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    public @ResponseBody String listCGEndPayByXMIdAndsupplierId(HttpServletRequest request) {
    	return xmFinanceService.listCGEndPayByXMIdAndsupplierId(requestParameterToMap(request));
    }
    /**
     * 项目支出结算审批
     * @param request
     * @return
     */
    @RequestMapping(value = "/getXmEndPayMain", method = RequestMethod.GET, produces = "text/html;charset=UTF-8")
    public @ResponseBody String getXmEndPayMain(HttpServletRequest request) {
    	return xmFinanceService.getXmEndPayMain(requestParameterToMap(request));
    }
    
    /**
     * 项目支出结算审批列表添加
     * @param request
     * @return
     */
    @RequestMapping(value = "/addXMEndPayMain", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    public @ResponseBody String addXMEndPayMain(HttpServletRequest request) {
    	return xmFinanceService.addXMEndPayMain(requestParameterToMapUser(request));
    }
    
    
    /**
     * 项目支出结算审批列表更新
     * @param request
     * @return
     */
    @RequestMapping(value = "/updateXMEndPayMain", method = RequestMethod.POST, produces = "text/html;charset=UTF-8")
    public @ResponseBody String updateXMEndPayMain(HttpServletRequest request) {
    	return xmFinanceService.updateXMEndPayMain(requestParameterToMapUser(request));
    }
    /**
     * 项目质保金查看
     */
    @RequestMapping(value = "/listPageXMWarranty", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String listPageXMWarranty(HttpServletRequest request) {
    	Map<String, Object> map = getPagerMap(request);
    	map.putAll(requestParameterToMapUser(request));
    	return xmFinanceService.listPageXMWarranty(map);
    }
    /**
     * 项目票号更新
     */
    @RequestMapping(value = "/updateInvoiceCode", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public @ResponseBody String updateInvoiceCode(HttpServletRequest request) {
    	Map<String, Object> map = this.requestParameterToMapUser(request);
    	return xmFinanceService.updateInvoiceCode(map);
    }  
    
}
